package source.model.utility;

import source.model.ObjectID;

public class EatAtJoesIterator {
	
	private ObjectID[] oids;
	private int currentIndex, length;
	
	public EatAtJoesIterator( ObjectID[] oids ) {
		this.oids = oids;
		length = oids.length;
		currentIndex = 0;
	}
	
	public ObjectID getNext() {
		if(length == 0) return null;		
		ObjectID temp =  oids[currentIndex++];
		if (currentIndex == length)
			currentIndex = 0;
		return temp;
	}
	
	public int getLength()
	{
		return length;
	}
}
